package org.zoomdev.zoom.dao.adapters.result;

import org.zoomdev.zoom.dao.adapters.ResultSetAdapter;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Time;
import java.time.LocalTime;

public class Time2LocalTimeResultSetAdapter implements ResultSetAdapter<LocalTime> {
    @Override
    public LocalTime getObject(ResultSet rs, int index) throws SQLException {
        Time time = rs.getTime(index);
        if (time == null) {
            return null;
        }
        return time.toLocalTime();
    }
}
